

package jumavidesktop.Persistencia.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import jumavidesktop.Persistencia.entidades.EnumeracionesEntidades.TipoRecursoMotion;

/**
 *
 * @author vimso
 */
@Entity
@Table(name = "configdetectionmotion")
@NamedQueries({
    @NamedQuery(name = "Configdetectionmotion.findAll", query = "SELECT c FROM Configdetectionmotion c"),
    @NamedQuery(name = "Configdetectionmotion.findById", query = "SELECT c FROM Configdetectionmotion c WHERE c.id = :id"),
    @NamedQuery(name = "Configdetectionmotion.findBySizeCuadrado", query = "SELECT c FROM Configdetectionmotion c WHERE c.sizeCuadrado = :sizeCuadrado"),
    @NamedQuery(name = "Configdetectionmotion.findByUmbralSensibilidad", query = "SELECT c FROM Configdetectionmotion c WHERE c.umbralSensibilidad = :umbralSensibilidad"),
    @NamedQuery(name = "Configdetectionmotion.findByTipoRecurso", query = "SELECT c FROM Configdetectionmotion c WHERE c.tipoRecurso = :tipoRecurso"),
    @NamedQuery(name = "Configdetectionmotion.findByDatosRecursos", query = "SELECT c FROM Configdetectionmotion c WHERE c.datosRecursos = :datosRecursos"),
    @NamedQuery(name = "Configdetectionmotion.findByCamaraid", query = "SELECT c FROM Configdetectionmotion c WHERE c.camara = :camara")})
public class Configdetectionmotion implements Serializable {
    private static final long serialVersionUID = 1L;
     
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Id
    private Integer id;
    @Basic(optional = false)
    @Column(name = "sizeCuadrado")
    private int sizeCuadrado;
    @Basic(optional = false)
    @Column(name = "umbralSensibilidad")
    private int umbralSensibilidad;
    @Basic(optional = false)
    @Column(name = "TipoRecurso")
    @Enumerated(EnumType.STRING)
    private EnumeracionesEntidades.TipoRecursoMotion tipoRecurso;    
    @Basic(optional = false)
    @Column(name = "DatosRecursos")
    private String datosRecursos;
    @JoinColumn(name = "Camara_id", referencedColumnName = "id", insertable = true, updatable = true)
    @OneToOne(optional = false)
    private Camara camara;

    public Configdetectionmotion() {
    }
    
    public int getSizeCuadrado() {
        return sizeCuadrado;
    }

    public void setSizeCuadrado(int sizeCuadrado) {
        this.sizeCuadrado = sizeCuadrado;
    }

    public int getUmbralSensibilidad() {
        return umbralSensibilidad;
    }

    public void setUmbralSensibilidad(int umbralSensibilidad) {
        this.umbralSensibilidad = umbralSensibilidad;
    }

    public TipoRecursoMotion getTipoRecurso() {
        return tipoRecurso;
    }

    public void setTipoRecurso(TipoRecursoMotion tipoRecurso) {
        this.tipoRecurso = tipoRecurso;
    }

    public String getDatosRecursos() {
        return datosRecursos;
    }

    public void setDatosRecursos(String datosRecursos) {
        this.datosRecursos = datosRecursos;
    }

    public Camara getCamara() {
        return camara;
    }

    public void setCamara(Camara camara) {
        this.camara = camara;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Configdetectionmotion)) {
            return false;
        }
        Configdetectionmotion other = (Configdetectionmotion) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
    return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jumavidesktop.Persistencia.entidades.Configdetectionmotion[ id=" + id + " ]";
    }

}
